﻿// -----------------------------------------------------------------------
// <copyright file="Inverter.cs" company="Microsoft">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace TouchExplorer.FileComparers
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public class Inverter<T> : IComparer<T>
    {
        private IComparer<T> _comparer;
        public Inverter(IComparer<T> comparer)
        {
            _comparer = comparer;
        }

        public int Compare(T x, T y)
        {
            var res = _comparer.Compare(x, y);
            if (res == 0) return 0;

            return -res;
        }
    }
}
